﻿@model CultuRAM.Models.Comment

@{
    ViewBag.Title = "Editar Comentário";

}

<h4>Editar Comentário</h4>
<br />
@using (Ajax.BeginForm("EditPv", "Comment", new AjaxOptions
{
    UpdateTargetId = "tabEventComRight",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    OnSuccess = "UpdateEventCom(" + @Model.EventId + ")"
}))
{
    @*@Html.ValidationSummary(false)*@

    <fieldset>
        <legend>Comentário</legend>
        
        @Html.HiddenFor(model => model.CommentId)
        @Html.HiddenFor(model => model.EventId, new { id = "EventId" }) @*//NAO ALTERAR*@
               
        <div class="control-group">
            @Html.LabelFor(model => model.Hide)     
            <div class="controls">
                @Html.CheckBoxFor(model => model.Hide)
                @*@Html.ValidationMessageFor(model => model.Hide)*@
            </div>
        </div> 

        <div class="control-group">
            @Html.LabelFor(model => model.Name)     
            <div class="controls">
                @Html.TextBoxFor(model => model.Name, null, new {@style = "width: 510px !important;" })
                @*@Html.ValidationMessageFor(model => model.Title)*@
            </div>
        </div>         
        
        <div class="control-group">
            @Html.LabelFor(model => model.CommentText)     
            <div class="controls">
                @Html.TextBoxFor(model => model.CommentText, null, new {@style = "width: 510px !important;" })
                @*@Html.ValidationMessageFor(model => model.Title)*@
            </div>
        </div>
        
        @if (Model.Responses != null && Model.Responses.Count != 0)
        {
            <table id="tabCom1" class="table table-hover table-striped table-bordered" style="width: 100%; font-size: 9px;">
                <tr>
                    <th style="width: 15%;">
                        @Html.DisplayNameFor(model => model.Name)
                    </th>
                    <th style="width: 85%;">
                        @Html.DisplayNameFor(model => model.CommentText)
                    </th>
                </tr>
                @foreach (var item in Model.Responses)
                {
                    <tr id="@item.CommentId">
                        <td>
                            @Html.DisplayFor(modelItem => item.Name)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.CommentText)
                        </td>
                    </tr>
                }
            </table>
        }
        <p>
            <button  type="submit" value="Guardar" class="btn btn-primary">Guardar</button>
            @Ajax.ActionLink("Cancelar", "Default", null, new AjaxOptions()
            {
                UpdateTargetId = "tabEventComRight",
                InsertionMode = InsertionMode.Replace,
                OnSuccess = "ComBgColorClear()",
            }, new { @class = "btn btn-default" })
        </p>
    </fieldset>
}



@Scripts.Render("~/bundles/culturam")


